package com.redare.dev.smart.generator.sdk.pojo;

import com.redare.dev.smart.generator.sdk.utils.BuilderUtil;
import org.apache.commons.lang.StringUtils;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author yangqiangyu
 * @date 2021-08-28 11:44:05
 * Created by yangqiangyu
 */
public class OnlFormHead implements Serializable {

    public OnlFormHead() {
    }

    public OnlFormHead(List<OnlFormField> fields) {
        this.fields = fields;
    }

    /**
     * 自增主键
     */
    private Long id;

    /**
     * 系统id
     */
    private Long sysId;

    /**
     * 表名
     */
    private String tableName;

    /**
     * 生成实体名称
     */
    private String model;

    private String subPath;

    private boolean hasKey;

    private boolean exportExcel;

    private boolean batchDelete;

    private boolean imported;

    private boolean modalForm;

    /**
     * 表类型: 0单表、1主表、2附表
     */
    private Integer tableType;

    /**
     * 表版本
     */
    private Integer tableVersion;

    /**
     * 表说明
     */
    private String comment;

    private int formColumnCount = 3;

    /**
     * 是否带checkbox
     */
    private String isCheckbox;

    /**
     * 同步数据库状态
     */
    private String isDbSynch;

    /**
     * 是否分页
     */
    private boolean page;

    /**
     * 是否是树
     */
    private boolean tree;

    /**
     * 主键生成序列
     */
    private String idSequence;

    /**
     * 主键类型
     */
    private String idType;

    /**
     * 查询模式
     */
    private String queryMode;

    /**
     * 映射关系 0一对多  1一对一
     */
    private Integer relationType;

    /**
     * 子表
     */
    private String subTableStr;

    /**
     * 附表排序序号
     */
    private Integer tabOrderNum;

    /**
     * 树形表单父id
     */
    private String treeParentIdField;

    /**
     * 树表主键字段
     */
    private String treeIdField;

    /**
     * 树开表单列字段
     */
    private String treeFieldname;

    /**
     * 表单分类
     */
    private String formCategory;

    /**
     * PC表单模板
     */
    private String formTemplate;

    /**
     * 表单模板样式(移动端)
     */
    private String formTemplateMobile;

    /**
     * 是否有横向滚动条
     */
    private Integer scroll;

    /**
     * 复制版本号
     */
    private Integer copyVersion;

    /**
     * 复制表类型1为复制表 0为原始表
     */
    private Integer copyType;

    /**
     * 原始表ID
     */
    private String physicId;

    /**
     * 扩展JSON
     */
    private String extConfigJson;

    /**
     * 修改人
     */
    private String updateBy;

    /**
     * 修改时间
     */
    private Date updateTime;

    /**
     * 创建人
     */
    private String createBy;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 主题模板
     */
    private String themeTemplate;

    /**
     * 是否用设计器表单
     */
    private String isDesForm;

    /**
     * 设计器表单编码
     */
    private String desFormCode;

    private List<OnlFormField> fields;

    /**
     * 子表
     */
    private List<OnlFormHead> children;

    public Long getId() {
        return id;
    }

    public OnlFormHead setId(Long id) {
        this.id = id;
        return this;
    }


    public Long getSysId() {
        return sysId;
    }

    public OnlFormHead setSysId(Long sysId) {
        this.sysId = sysId;
        return this;
    }


    public String getTableName() {
        return tableName;
    }

    public OnlFormHead setTableName(String tableName) {
        this.tableName = tableName;
        this.model = BuilderUtil.underlineToCamel(tableName, true);
        return this;
    }

    public String getModel() {
        return model;
    }

    public OnlFormHead setModel(String model) {
        this.model = model;
        return this;
    }

    public String getSubPath() {
        return subPath;
    }

    public OnlFormHead setSubPath(String subPath) {
        this.subPath = subPath;
        return this;
    }

    public boolean isHasKey() {
        return hasKey;
    }

    public OnlFormHead setHasKey(boolean hasKey) {
        this.hasKey = hasKey;
        return this;
    }

    public boolean isExportExcel() {
        return exportExcel;
    }

    public OnlFormHead setExportExcel(boolean exportExcel) {
        this.exportExcel = exportExcel;
        return this;
    }

    public boolean isBatchDelete() {
        return batchDelete;
    }

    public OnlFormHead setBatchDelete(boolean batchDelete) {
        this.batchDelete = batchDelete;
        return this;
    }

    public boolean isImported() {
        return imported;
    }

    public OnlFormHead setImported(boolean imported) {
        this.imported = imported;
        return this;
    }

    public boolean isModalForm() {
        return modalForm;
    }

    public OnlFormHead setModalForm(boolean modalForm) {
        this.modalForm = modalForm;
        return this;
    }

    public Integer getTableType() {
        return tableType;
    }

    public OnlFormHead setTableType(Integer tableType) {
        this.tableType = tableType;
        return this;
    }


    public Integer getTableVersion() {
        return tableVersion;
    }

    public OnlFormHead setTableVersion(Integer tableVersion) {
        this.tableVersion = tableVersion;
        return this;
    }

    public String getComment() {
        return comment;
    }

    public OnlFormHead setComment(String comment) {
        this.comment = comment;
        return this;
    }

    public int getFormColumnCount() {
        return formColumnCount;
    }

    public OnlFormHead setFormColumnCount(int formColumnCount) {
        this.formColumnCount = formColumnCount;
        return this;
    }

    public String getIsCheckbox() {
        return isCheckbox;
    }

    public OnlFormHead setIsCheckbox(String isCheckbox) {
        this.isCheckbox = isCheckbox;
        return this;
    }


    public String getIsDbSynch() {
        return isDbSynch;
    }

    public OnlFormHead setIsDbSynch(String isDbSynch) {
        this.isDbSynch = isDbSynch;
        return this;
    }

    public boolean isPage() {
        return page;
    }

    public OnlFormHead setPage(boolean page) {
        this.page = page;
        return this;
    }

    public boolean isTree() {
        return tree;
    }

    public OnlFormHead setTree(boolean tree) {
        this.tree = tree;
        return this;
    }

    public String getIdSequence() {
        return idSequence;
    }

    public OnlFormHead setIdSequence(String idSequence) {
        this.idSequence = idSequence;
        return this;
    }


    public String getIdType() {
        return idType;
    }

    public OnlFormHead setIdType(String idType) {
        this.idType = idType;
        return this;
    }


    public String getQueryMode() {
        return queryMode;
    }

    public OnlFormHead setQueryMode(String queryMode) {
        this.queryMode = queryMode;
        return this;
    }


    public Integer getRelationType() {
        return relationType;
    }

    public OnlFormHead setRelationType(Integer relationType) {
        this.relationType = relationType;
        return this;
    }


    public String getSubTableStr() {
        return subTableStr;
    }

    public OnlFormHead setSubTableStr(String subTableStr) {
        this.subTableStr = subTableStr;
        return this;
    }


    public Integer getTabOrderNum() {
        return tabOrderNum;
    }

    public OnlFormHead setTabOrderNum(Integer tabOrderNum) {
        this.tabOrderNum = tabOrderNum;
        return this;
    }


    public String getTreeParentIdField() {
        return treeParentIdField;
    }

    public OnlFormHead setTreeParentIdField(String treeParentIdField) {
        this.treeParentIdField = treeParentIdField;
        return this;
    }


    public String getTreeIdField() {
        return treeIdField;
    }

    public OnlFormHead setTreeIdField(String treeIdField) {
        this.treeIdField = treeIdField;
        return this;
    }


    public String getTreeFieldname() {
        return treeFieldname;
    }

    public OnlFormHead setTreeFieldname(String treeFieldname) {
        this.treeFieldname = treeFieldname;
        return this;
    }


    public String getFormCategory() {
        return formCategory;
    }

    public OnlFormHead setFormCategory(String formCategory) {
        this.formCategory = formCategory;
        return this;
    }


    public String getFormTemplate() {
        return formTemplate;
    }

    public OnlFormHead setFormTemplate(String formTemplate) {
        this.formTemplate = formTemplate;
        return this;
    }


    public String getFormTemplateMobile() {
        return formTemplateMobile;
    }

    public OnlFormHead setFormTemplateMobile(String formTemplateMobile) {
        this.formTemplateMobile = formTemplateMobile;
        return this;
    }


    public Integer getScroll() {
        return scroll;
    }

    public OnlFormHead setScroll(Integer scroll) {
        this.scroll = scroll;
        return this;
    }


    public Integer getCopyVersion() {
        return copyVersion;
    }

    public OnlFormHead setCopyVersion(Integer copyVersion) {
        this.copyVersion = copyVersion;
        return this;
    }


    public Integer getCopyType() {
        return copyType;
    }

    public OnlFormHead setCopyType(Integer copyType) {
        this.copyType = copyType;
        return this;
    }


    public String getPhysicId() {
        return physicId;
    }

    public OnlFormHead setPhysicId(String physicId) {
        this.physicId = physicId;
        return this;
    }


    public String getExtConfigJson() {
        return extConfigJson;
    }

    public OnlFormHead setExtConfigJson(String extConfigJson) {
        this.extConfigJson = extConfigJson;
        return this;
    }


    public String getUpdateBy() {
        return updateBy;
    }

    public OnlFormHead setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
        return this;
    }




    public String getCreateBy() {
        return createBy;
    }

    public OnlFormHead setCreateBy(String createBy) {
        this.createBy = createBy;
        return this;
    }

    public String getThemeTemplate() {
        return themeTemplate;
    }

    public OnlFormHead setThemeTemplate(String themeTemplate) {
        this.themeTemplate = themeTemplate;
        return this;
    }


    public String getIsDesForm() {
        return isDesForm;
    }

    public OnlFormHead setIsDesForm(String isDesForm) {
        this.isDesForm = isDesForm;
        return this;
    }


    public String getDesFormCode() {
        return desFormCode;
    }

    public OnlFormHead setDesFormCode(String desFormCode) {
        this.desFormCode = desFormCode;
        return this;
    }


    public Date getCreateTime() {
        return createTime;
    }

    public OnlFormHead setCreateTime(Date createTime) {
        this.createTime = createTime;
        return this;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public OnlFormHead setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
        return this;
    }

    public List<OnlFormField> getFields() {
        return fields;
    }

    public OnlFormHead setFields(List<OnlFormField> fields) {
        this.fields = fields;
        return this;
    }

    public List<OnlFormHead> getChildren() {
        return children;
    }

    public OnlFormHead setChildren(List<OnlFormHead> children) {
        this.children = children;
        return this;
    }
}